/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package etp.coofy;

import etp.coofy.Commands.USB_Status;

/**
 *
 * @author mikulski
 */
public class scanStatus implements Runnable {
    
    private USB_Status UCStatus;
    private etp.USB.USBService usb;
    private boolean running;
    
    public scanStatus(etp.USB.USBService usb, USB_Status UCStatus) {
        this.UCStatus = UCStatus;
        this.usb = usb;
        this.running = true;
        System.out.println("ScanStatus erstellt");
    }

    @Override
    public void run() {
        while(this.running) {
            this.UCStatus.sendCommand(this.usb);
            System.out.println("ScanStatus sendet");
            try { 
                Thread.sleep( 1000 ); 
            } catch ( InterruptedException e ) { 
                ;
            }
        }
    }
    
    public void setRunning(boolean running) {
        this.running = running;
    }
}
